var e = require;
var t = module;
var o = exports;
var n,
    i = o,
    a =
        ((n = function (e, t) {
            return (n =
                Object.setPrototypeOf ||
                ({__proto__: []} instanceof Array &&
                    function (e, t) {
                        e.__proto__ = t;
                    }) ||
                function (e, t) {
                    for (var o in t) t.hasOwnProperty(o) && (e[o] = t[o]);
                })(e, t);
        }),
        function (e, t) {
            function o() {
                this.constructor = e;
            }
            n(e, t), (e.prototype = null === t ? Object.create(t) : ((o.prototype = t.prototype), new o()));
        }),
    r = function (e, t, o, n) {
        var i,
            a = arguments.length,
            r = a < 3 ? t : null === n ? (n = Object.getOwnPropertyDescriptor(t, o)) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, o, n);
        else
            for (var s = e.length - 1; s >= 0; s--)
                (i = e[s]) && (r = (a < 3 ? i(r) : a > 3 ? i(t, o, r) : i(t, o)) || r);
        return a > 3 && r && Object.defineProperty(t, o, r), r;
    };
Object.defineProperty(i, "__esModule", {value: !0});
var s = e("WechatExportManager"),
    c = e("AdItem"),
    l = cc._decorator,
    d = l.ccclass,
    u = l.property,
    p = (function (e) {
        function t() {
            var t = (null !== e && e.apply(this, arguments)) || this;
            return (t.node_item = null), (t.style = {}), t;
        }
        var o;
        return (
            a(t, e),
            (o = t),
            (t.prototype.start = function () {
                var e = this,
                    t = this.node_item.getComponent(cc.Widget);
                void 0 !== this.style.top && null !== this.style.top && ((t.isAlignTop = !0), (t.top = this.style.top)),
                    void 0 !== this.style.bottom &&
                        null !== this.style.bottom &&
                        ((t.isAlignBottom = !0), (t.bottom = this.style.bottom)),
                    void 0 !== this.style.left &&
                        null !== this.style.left &&
                        ((t.isAlignLeft = !0), (t.left = this.style.left)),
                    void 0 !== this.style.right &&
                        null !== this.style.right &&
                        ((t.isAlignRight = !0), (t.right = this.style.right)),
                    t.updateAlignment(),
                    this.refreshData(),
                    this.schedule(function () {
                        e.node_item.getComponent(cc.Animation).play(), e.refreshData();
                    }, 4);
            }),
            (t.prototype.refreshData = function () {
                if (s.default.instance.gameList.length > 0) {
                    o._currShowIndex >= s.default.instance.gameList.length && (o._currShowIndex = 0);
                    var e = s.default.instance.gameList[o._currShowIndex];
                    this.node_item.getComponent(c.default).setData(e),
                        this.node_item.getComponent(c.default).updateView(),
                        o._currShowIndex++;
                }
            }),
            (t._currShowIndex = 0),
            r([u(cc.Node)], t.prototype, "node_item", void 0),
            (o = r([d], t))
        );
    })(cc.Component);
i.default = p;
